package com.ctshk.rpc.guide.mapper;

import com.ctshk.rpc.guide.entity.GuideCollarMonthlyLeave;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 导领月假表 Mapper 接口
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-03-08
 */
public interface GuideCollarMonthlyLeaveMapper extends BaseMapper<GuideCollarMonthlyLeave> {

    @Select("select monthly_leave from t_guide_collar_monthly_leave where is_deleted = 0 and guide_collar_id = #{guideCollarId} and DATE_FORMAT(#{now},\"%y-%m\") = DATE_FORMAT(date,\"%y-%m\")")
    GuideCollarMonthlyLeave selectByMonthAndId(@Param("guideCollarId")Long guideCollarId,@Param("now") LocalDate now);
}
